<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>File: README</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



  <div id="fileHeader">
    <h1>README</h1>
    <table class="header-table">
    <tr class="top-aligned-row">
      <td><strong>Path:</strong></td>
      <td>README
      </td>
    </tr>
    <tr class="top-aligned-row">
      <td><strong>Last Update:</strong></td>
      <td>Fri Feb 20 13:49:43 -0800 2009</td>
    </tr>
    </table>
  </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <h1><a href="../classes/GData.html">GData</a></h1>
<ul>
<li><a href="http://code.google.com/p/gdata">code.google.com/p/gdata</a>

</li>
</ul>
<h2>DESCRIPTION:</h2>
<p>
Ruby wrapper for working with Google Data APIs
</p>
<h2>SYNOPSIS:</h2>
<pre>
  yt = GData::Client::YouTube.new
  yt.source = 'my_cool_application'
  yt.clientlogin('username', 'password')
  yt.client_id = 'CLIENT_ID'
  yt.developer_key = 'DEVELOPER_KEY'
  feed = yt.get('http://gdata.youtube.com/feeds/api/users/default/uploads').to_xml

  # creating, updating, and deleting a playlist

  entry = &lt;&lt;-EOF
  &lt;entry xmlns=&quot;http://www.w3.org/2005/Atom&quot;
      xmlns:yt=&quot;http://gdata.youtube.com/schemas/2007&quot;&gt;
    &lt;title type=&quot;text&quot;&gt;Ruby Utility Unit Test&lt;/title&gt;
    &lt;summary&gt;This is a test playlist.&lt;/summary&gt;
  &lt;/entry&gt;
  EOF

  response = yt.post('http://gdata.youtube.com/feeds/api/users/default/playlists', entry).to_xml

  edit_uri = response.elements[&quot;link[@rel='edit']&quot;].attributes['href']

  response.elements[&quot;summary&quot;].text = &quot;Updated description&quot;

  response = yt.put(edit_uri, response.to_s).to_xml

  yt.delete(edit_uri).to_xml

  # uploading a video

  test_movie = '/path/to/a/movie.mov'
  mime_type = 'video/quicktime'
  feed = 'http://uploads.gdata.youtube.com/feeds/api/users/default/uploads'

  entry = &lt;&lt;EOF
  &lt;entry xmlns=&quot;http://www.w3.org/2005/Atom&quot;
    xmlns:media=&quot;http://search.yahoo.com/mrss/&quot;
    xmlns:yt=&quot;http://gdata.youtube.com/schemas/2007&quot;&gt;
    &lt;media:group&gt;
      &lt;media:title type=&quot;plain&quot;&gt;Test Movie&lt;/media:title&gt;
      &lt;media:description type=&quot;plain&quot;&gt;
        This is a test with the Ruby library
      &lt;/media:description&gt;
      &lt;media:category
        scheme=&quot;http://gdata.youtube.com/schemas/2007/categories.cat&quot;&gt;People
      &lt;/media:category&gt;
      &lt;media:keywords&gt;test,lame&lt;/media:keywords&gt;
    &lt;/media:group&gt;
  &lt;/entry&gt;
  EOF

  response = @yt.post_file(feed, test_movie, mime_type, entry).to_xml
</pre>
<h2>REQUIREMENTS:</h2>
<ul>
<li>A sunny disposition

</li>
</ul>
<p>
Tested against Ruby 1.8.6 patch level 114
</p>
<h2>INSTALL:</h2>
<pre>
  sudo gem install gdata
</pre>
<p>
To generate documentation:
</p>
<pre>
  rake doc
</pre>
<p>
To run unit tests:
</p>
<pre>
  cp test/test_config.yml.example test/test_config.yml
  # edit test/test_config.yml
  rake test
</pre>
<h2>LICENSE:</h2>
<p>
Copyright (C) 2008 Google Inc.
</p>
<p>
Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
you may not use this file except in compliance with the License. You may
obtain a copy of the License at
</p>
<pre>
      http://www.apache.org/licenses/LICENSE-2.0
</pre>
<p>
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</p>

    </div>


   </div>


  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>